<!DOCTYPE html>
<html class="x-admin-sm">

    <head>
        <meta charset="UTF-8">
        <title>欢迎页面-X-admin2.2</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="css/font.css">
        <link rel="stylesheet" href="css/xadmin.css">
        <script src="lib/layui/layui.js" charset="utf-8"></script>
        <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
        <script type="text/javascript" src="js/xadmin.js"></script>
        <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>

    <body>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body">
                          <div class="layui-form-item" style="font-size: 16px;">
                            <label>分享链接：</label>
                            <span class="x-red" id="share_url"></span>
                            <div class="bdsharebuttonbox" data-tag="share_1" style="display: inline; float:right">
                              <a class="bds_sqq" data-cmd="sqq"></a>
                              <a class="bds_weixin" data-cmd="weixin"></a></div>
                          </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    <script>

        var url = location.search; //获取url中"?"符后的字串
        var theRequest = new Object();
        if (url.indexOf("?") != -1) {
            var str = url.substr(1);
            strs = str.split("&");
            for (var i = 0; i < strs.length; i++)
                theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);}
        var tableId = theRequest['tableId'];

        var url = "";
        $.ajax({
            url: "/contract/findUrl",
            dateType: "json",
            type: "get",
            data: {level1SystemId: tableId},
            success: function(res) {
                if(res.msg == 'success') {
                    url = res.data.sendUrl;
                    $("#share_url").text(url);
                    window._bd_share_config = {
                        common : {
                            //bdPopTitle:'窗口标题',
                            bdText : '正在转发 '+ tableId +' 号合同',
                            bdDesc : tableId +' 号合同链接：' +   $("#share_url").text(),    //自定义分享摘要
                            bdUrl : url,     //自定义分享url地址
                            bdPic : '' //自定义分享图片
                        },
                        share : [{
                            "bdSize" : 16
                        }],
                    }
                    with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?cdnversion='+~(-new Date()/36e5)];
                } else {
                    alert('接收链接失败');
                }
            }
        })

        //var url = 'localhost:8080/index.html?tableId='+tableId+'&preId='+creater+'&locatime='+localTime;

    </script>

    </body>
</html>